﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/MainFrame.Master"
    Inherits="System.Web.Mvc.ViewPage<IEnumerable<GPMS.Model.AnswerGroupVM>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    答辩组列表
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        答辩组信息</h2>
        <p>
             <%:Html.ActionLink("新增","Create",null,new {@class="dialog"} )%>
        </p>
    <table id="answerGrouplist">
        <tr>
            <th>
                名称
            </th>
            <th>
                日期
            </th>
            <th>
                开始时间
            </th>
            <th>
                结束时间
            </th>
            <th>
                组长
            </th>
            <th>
                教师
            </th>
            <th>
                学生
            </th>
            <th>
                操作
            </th>
        </tr>
        <%foreach (var item in Model)
          {%>
        <tr>
            <td>
                <%:item.AnswerGroup.Name %>
            </td>
            <td>
                <%:item.AnswerGroup.Date.ToShortDateString() %>
            </td>
            <td>
                <%:item.AnswerGroup.BeginTime%>
            </td>
            <td>
                <%:item.AnswerGroup.EndTime %>
            </td>
            <td>
                <%:item.Leader.RealName %>
            </td>
            <td>
                <%foreach (var tea in item.Teachers)
                      {%>
                <%:tea.RealName + ";"%>
                <%} %>
            </td>
            <td>
                <%foreach (var stu in item.Students)
                      {%>
                <%:stu.RealName+";" %>
                <%} %>
            </td>
             <td>
            <%:Html.ActionLink("修改","Edit",new {id=item.AnswerGroup.AnswerGroupID},new {@class="dialog"}) %>
            <%:Html.ActionLink("删除","Delete",new {id=item.AnswerGroup.AnswerGroupID},new {@class="dialog"} )%>
            <%:Html.ActionLink("增加人员","Add",new {id=item.AnswerGroup.AnswerGroupID},new {@class="dialog"} )%>
            <%:Html.ActionLink("删除人员","Remove",new {id=item.AnswerGroup.AnswerGroupID},new {@class="dialog"}) %>
            </td>
        </tr>
        <%} %>
    </table>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Header" runat="server">
    <link href="<%=Url.Content("~/Content/css/ui.jqgrid.css") %>" rel="Stylesheet" type="text/css" />
    <link href="<%=Url.Content("~/Content/css/admin.css") %>" rel="Stylesheet" type="text/css" />
    <script type="text/javascript" src="<%=Url.Content("~/Scripts/i18n/grid.locale-cn.js") %>"></script>
    <script type="text/javascript" src="<%=Url.Content("~/Scripts/jquery.jqGrid.min.js") %>"></script>
    <style type="text/css">
        body
        {
            background: white;
        }
    </style>
    <script type="text/javascript">
        $(function () {
            tableToGrid($("#answerGrouplist"), { width: 640, height: 320 });
            DialogLink($("a.dialog"), $("#dialogPanel"), { close: function () {
                $.unblockUI();
                //window.location.reload();
            }
            });
        });
        var reflashTag = {};
    </script>
</asp:Content>
